<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Everyday Series
Description: A three-column, fixed-width blog design.
Version    : 1.0
Released   : 20090617

-->
<?php
session_start();
if($_SESSION['login']==true){
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Add Employee</title>
<link href="template.css" rel="stylesheet" type="text/css" media="screen" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js" type="text/javascript"></script>
<script src="jquery.js"></script>
<script language='javascript'>
		var i;
		function fill_Dept(i){
			var dept = document.getElementById("empData");
			document.employeeData.department.options.length=0;
			switch(i)
			{
				case 0:
					dept.department.options[0] = new Option("AGRICULTURAL SYSTEMS CLUSTER", "AGRICULTURAL SYSTEMS CLUSTER");
					dept.department.options[1] = new Option("ANIMAL AND DAIRY SCIENCES CLUSTER", "ANIMAL AND DAIRY SCIENCES CLUSTER");
					dept.department.options[2] = new Option("CENTRAL EXPERIMENT STATION", "CENTRAL EXPERIMENT STATION");
					dept.department.options[3] = new Option("CROP PROTECTION CLUSTER", "CROP PROTECTION CLUSTER");
					dept.department.options[4] = new Option("CROP SCIENCE CLUSTER", "CROP SCIENCE CLUSTER");
					dept.department.options[5] = new Option("DEAN`S OFFICE", "DEAN`S OFFICE");
					dept.department.options[6] = new Option("FOOD SCIENCE CLUSTER", "FOOD SCIENCE CLUSTER");
					dept.department.options[7] = new Option("LA GRANJA RES & TRNG STATION", "LA GRANJA RES & TRNG STATION");
					dept.department.options[8] = new Option("PHIL AGRICULTURAL SCIENTIST", "PHIL AGRICULTURAL SCIENTIST");
					dept.department.options[9] = new Option("SECRETARY`S OFFICE", "SECRETARY`S OFFICE");
					break;
				case 1:
					dept.department.options[0] = new Option("DEAN`S OFFICE", "DEAN`S OFFICE");
					dept.department.options[1] = new Option("HUMAN KINETICS", "HUMAN KINETICS");
					dept.department.options[2] = new Option("HUMANITIES", "HUMANITIES");
					dept.department.options[3] = new Option("INST OF BIOLOGICAL SCIENCES", "INST OF BIOLOGICAL SCIENCES");
					dept.department.options[4] = new Option("INST OF CHEMISTRY", "INST OF CHEMISTRY");
					dept.department.options[5] = new Option("INST OF COMPUTER SCIENCE", "INST OF COMPUTER SCIENCE");
					dept.department.options[6] = new Option("INST OF MATH SCI & PHYSICS", "INST OF MATH SCI & PHYSICS");
					dept.department.options[7] = new Option("INST OF STATISTICS", "INST OF STATISTICS");
					dept.department.options[8] = new Option("SECRETARY`S OFFICE", "SECRETARY`S OFFICE");
					dept.department.options[9] = new Option("SOCIAL SCIENCES", "SOCIAL SCIENCES");
					dept.department.options[10] = new Option("UP RURAL HIGH SCHOOL", "UP RURAL HIGH SCHOOL");
					dept.department.options[11] = new Option("UPLB LIMNOLOGICAL STATION", "UPLB LIMNOLOGICAL STATION");
					break;
				case 2:
					dept.department.options[0] = new Option("COLLEGE SECRETARY'S OFFICE", "COLLEGE SECRETARY'S OFFICE");
					dept.department.options[1] = new Option("DEAN`S OFFICE", "DEAN`S OFFICE");
					dept.department.options[2] = new Option("DEPT OF DEVELOPMENT BROADCASTING & TELECOMMUNICATION", "DEPT OF DEVELOPMENT BROADCASTING & TELECOMMUNICATION");
					dept.department.options[3] = new Option("DEPT OF DEVELOPMENT JOURNALISM", "DEPT OF DEVELOPMENT JOURNALISM");
					dept.department.options[4] = new Option("DEPT OF EDUCATIONAL COMMUNICATION", "DEPT OF EDUCATIONAL COMMUNICATION");
					dept.department.options[5] = new Option("DEPT OF SCIENCE COMMUNICATION", "DEPT OF SCIENCE COMMUNICATION");
					break;
				case 3:
					dept.department.options[0] = new Option("AMDP", "AMDP");
					dept.department.options[1] = new Option("AMTEC", "AMTEC");
					dept.department.options[2] = new Option("CHEMICAL ENGINEERING", "CHEMICAL ENGINEERING");
					dept.department.options[3] = new Option("CIVIL ENGINEERING", "CIVIL ENGINEERING");
					dept.department.options[4] = new Option("DEAN`S OFFICE", "DEAN`S OFFICE");
					dept.department.options[5] = new Option("DEPT OF INDUSTRIAL ENGINEERING", "DEPT OF INDUSTRIAL ENGINEERING");
					dept.department.options[6] = new Option("ELECTRICAL ENGINEERING", "ELECTRICAL ENGINEERING");
					dept.department.options[7] = new Option("ENGINEERING SCIENCE", "ENGINEERING SCIENCE");
					dept.department.options[8] = new Option("INST OF AG ENGINEERING", "INST OF AG ENGINEERING");
					dept.department.options[9] = new Option("LIBRARY", "LIBRARY");
					dept.department.options[10] = new Option("SECRETARY`S OFFICE", "SECRETARY`S OFFICE");
					break;
				case 4:
					dept.department.options[0] = new Option("DEAN`S OFFICE", "DEAN`S OFFICE");
					dept.department.options[1] = new Option("DEPT OF AGRIBUSINESS AND MANAGEMENT", "DEPT OF AGRIBUSINESS AND MANAGEMENT");
					dept.department.options[2] = new Option("DEPT OF AGRICULTURAL ECONOMICS", "DEPT OF AGRICULTURAL ECONOMICS");
					dept.department.options[3] = new Option("DEPT OF ECONOMICS", "DEPT OF ECONOMICS");
					dept.department.options[4] = new Option("INSTITUTE OF COOPERATIVES AND BIO-ENTERPRISE DEVELOPMENT", "INSTITUTE OF COOPERATIVES AND BIO-ENTERPRISE DEVELOPMENT");
					dept.department.options[5] = new Option("SECRETARY`S OFFICE", "SECRETARY`S OFFICE");
					break;
				case 5:
					dept.department.options[0] = new Option("ADMINISTRATIVE SERVICES OFFICE", "ADMINISTRATIVE SERVICES OFFICE");
					dept.department.options[1] = new Option("COLLEGE LIBRARY", "COLLEGE LIBRARY");
					dept.department.options[2] = new Option("COLLEGE SECRETARY`S OFFICE", "COLLEGE SECRETARY`S OFFICE");
					dept.department.options[3] = new Option("DEPT OF FOREST BIOLOGICAL SCIENCES", "DEPT OF FOREST BIOLOGICAL SCIENCES");
					dept.department.options[4] = new Option("DEPT OF FOREST PRODUCTS & PAPER SCIENCE", "DEPT OF FOREST PRODUCTS & PAPER SCIENCE");
					dept.department.options[5] = new Option("DEPT OF SOCIAL FORESTRY & FOREST GOVERNANCE", "DEPT OF SOCIAL FORESTRY & FOREST GOVERNANCE");
					dept.department.options[6] = new Option("FORESTRY DEVELOPMENT CENTER", "FORESTRY DEVELOPMENT CENTER");
					dept.department.options[7] = new Option("INST OF AGROFORESTRY", "INST OF AGROFORESTRY");
					dept.department.options[8] = new Option("INST OF RENEWABLE NATURAL RESOURCES", "INST OF RENEWABLE NATURAL RESOURCES");
					dept.department.options[9] = new Option("MAKILING CENTER FOR MOUNTAIN ECOSYSTEMS", "MAKILING CENTER FOR MOUNTAIN ECOSYSTEMS");
					dept.department.options[10] = new Option("OFFICE OF THE ASSOCIATE DEAN", "OFFICE OF THE ASSOCIATE DEAN");
					dept.department.options[11] = new Option("OFFICE OF THE COORDINATOR FOR RESEARCH & EXTESION", "OFFICE OF THE COORDINATOR FOR RESEARCH & EXTESION");
					dept.department.options[12] = new Option("OFFICE OF THE DEAN", "OFFICE OF THE DEAN");
					dept.department.options[13] = new Option("TRAINING CENTER FOR TROPICAL RESOURCES & ECOSYSTEMS SUSTAINABILITY", "TRAINING CENTER FOR TROPICAL RESOURCES & ECOSYSTEMS SUSTAINABILITY");
					break;
				case 6:
					dept.department.options[0] = new Option("COMMTY & ENVIRONMNTL RES PLNG", "COMMTY & ENVIRONMNTL RES PLNG");
					dept.department.options[1] = new Option("DEAN`S OFFICE", "DEAN`S OFFICE");
					dept.department.options[2] = new Option("HUMAN & FAMILY DEV STUDIES", "HUMAN & FAMILY DEV STUDIES");
					dept.department.options[3] = new Option("IHNF-BIDANI", "IHNF-BIDANI");
					dept.department.options[4] = new Option("INST OF HUMAN NUTRITION & FOOD", "INST OF HUMAN NUTRITION & FOOD");
					dept.department.options[5] = new Option("SECRETARY`S OFFICE", "SECRETARY`S OFFICE");
					dept.department.options[6] = new Option("SOCIAL DEVELOPMENT SERVICES", "SOCIAL DEVELOPMENT SERVICES");
					break;
				case 7:
					dept.department.options[0] = new Option("DEAN`S OFFICE", "DEAN`S OFFICE");
					dept.department.options[1] = new Option("INST OF COMMUNITY EDUCATION", "INST OF COMMUNITY EDUCATION");
					dept.department.options[2] = new Option("INST OF DEVELOPMENT MANAGEMENT & GOVERNANCE", "INST OF DEVELOPMENT MANAGEMENT & GOVERNANCE");
					dept.department.options[3] = new Option("INST OF STRATEGIC PLANNING & POLICY STUDIES", "INST OF STRATEGIC PLANNING & POLICY STUDIES");
					dept.department.options[4] = new Option("INSTITUTE OF AGRARIAN AND RURBAN DEVELOPMENT STUDIES", "INSTITUTE OF AGRARIAN AND RURBAN DEVELOPMENT STUDIES");
					dept.department.options[5] = new Option("OFFICE OF THE GRADUATE PROGRAM", "OFFICE OF THE GRADUATE PROGRAM");
					break;
				case 8:
					dept.department.options[0] = new Option("ADMINISTRATIVE SERVICES OFFICE", "ADMINISTRATIVE SERVICES OFFICE");
					dept.department.options[1] = new Option("BASIC VETERINARY SCIENCES", "BASIC VETERINARY SCIENCES");
					dept.department.options[2] = new Option("DEAN`S OFFICE", "DEAN`S OFFICE");
					dept.department.options[3] = new Option("LIBRARY", "LIBRARY");
					dept.department.options[4] = new Option("SECRETARY`S OFFICE", "SECRETARY`S OFFICE");
					dept.department.options[5] = new Option("VET CLINICAL SCIENCES", "VET CLINICAL SCIENCES");
					dept.department.options[6] = new Option("VET PARACLINICAL SCIENCES", "VET PARACLINICAL SCIENCES");
					dept.department.options[7] = new Option("VETERINARY TEACHING HOSPITAL", "VETERINARY TEACHING HOSPITAL");
					break;
				case 9:
					dept.department.options[0] = new Option("GRADUATE SCHOOL", "GRADUATE SCHOOL");
					break;
				case 10:
					dept.department.options[0] = new Option("INTERNAL CONTROL OFFICE", "INTERNAL CONTROL OFFICE");
					dept.department.options[1] = new Option("LEGAL OFFICE", "LEGAL OFFICE");
					dept.department.options[2] = new Option("OFFICE FOR INITIATIVES IN CULTURE AND THE ARTS", "OFFICE FOR INITIATIVES IN CULTURE AND THE ARTS");
					dept.department.options[3] = new Option("OFFICE OF ALUMNI RELATIONS", "OFFICE OF ALUMNI RELATIONS");
					dept.department.options[4] = new Option("OFFICE OF PUBLIC RELATIONS", "OFFICE OF PUBLIC RELATIONS");
					dept.department.options[5] = new Option("OFFICE OF STUDENT AFFAIRS", "OFFICE OF STUDENT AFFAIRS");
					dept.department.options[6] = new Option("OFFICE OF THE CHANCELLOR", "OFFICE OF THE CHANCELLOR");
					break;
				case 11:
					dept.department.options[0] = new Option("ACCOUNTING OFFICE", "ACCOUNTING OFFICE");
					dept.department.options[1] = new Option("BUDGET MANAGEMENT OFFICE", "BUDGET MANAGEMENT OFFICE");
					dept.department.options[2] = new Option("BUSINESS AFFAIRS OFFICE", "BUSINESS AFFAIRS OFFICE");
					dept.department.options[3] = new Option("CASHIER`S OFFICE", "CASHIER`S OFFICE");
					dept.department.options[4] = new Option("CONTINUING EDUCATION CENTER", "CONTINUING EDUCATION CENTER");
					dept.department.options[5] = new Option("HUMAN RESOURCE DEV OFFICE", "HUMAN RESOURCE DEV OFFICE");
					dept.department.options[6] = new Option("OVCA", "OVCA");
					dept.department.options[7] = new Option("OFFICE OF THE UNIV REGISTRAR", "OFFICE OF THE UNIV REGISTRAR");
					dept.department.options[8] = new Option("RECORDS MANAGEMENT OFFICE", "RECORDS MANAGEMENT OFFICE");
					dept.department.options[9] = new Option("SPMO", "SPMO");
					break;
				case 12:
					dept.department.options[0] = new Option("LAND GRANT MANAGEMENT OFFICE", "LAND GRANT MANAGEMENT OFFICE");
					dept.department.options[1] = new Option("OVCCA", "OVCCA");
					dept.department.options[2] = new Option("UNIVERSITY HEALTH SERVICE", "UNIVERSITY HEALTH SERVICE");
					dept.department.options[3] = new Option("UNIVERSITY POLICE FORCE", "UNIVERSITY POLICE FORCE");
					dept.department.options[4] = new Option("UPLB HOUSING OFFICE", "UPLB HOUSING OFFICE");
					break;
				case 13:
					dept.department.options[0] = new Option("DEPT OF MILITARY SCI & TACTICS", "DEPT OF MILITARY SCI & TACTICS");
					dept.department.options[1] = new Option("INTERACTIVE LEARNING CENTER", "INTERACTIVE LEARNING CENTER");
					dept.department.options[2] = new Option("OVCI", "OVCI");
					dept.department.options[3] = new Option("OFF OF INSTITUTIONAL LINKAGES", "OFF OF INSTITUTIONAL LINKAGES");
					dept.department.options[4] = new Option("OFFICE OF THE UNIV REGISTRAR", "OFFICE OF THE UNIV REGISTRAR");
					dept.department.options[5] = new Option("SENTRO NG WIKANG PILIPINO", "SENTRO NG WIKANG PILIPINO");
					dept.department.options[6] = new Option("UNIVERSITY LIBRARY", "UNIVERSITY LIBRARY");
					dept.department.options[7] = new Option("UNIVERSITY PUBLICATIONS OFFICE", "UNIVERSITY PUBLICATIONS OFFICE");
					break;
				case 14:
					dept.department.options[0] = new Option("CAMPUS PLANNING & DEV OFFICE", "CAMPUS PLANNING & DEV OFFICE");
					dept.department.options[1] = new Option("OVCPD", "OVCPD");
					dept.department.options[2] = new Option("PPMSO", "PPMSO");
					dept.department.options[3] = new Option("UPLB INFORMATION TECHNOLOGY CENTER", "UPLB INFORMATION TECHNOLOGY CENTER");
					break;
				case 15:
					dept.department.options[0] = new Option("BIOTECH", "BIOTECH");
					dept.department.options[1] = new Option("MUSEUM OF NATURAL HISTORY", "MUSEUM OF NATURAL HISTORY");
					dept.department.options[2] = new Option("OVCRE", "OVCRE");
					dept.department.options[3] = new Option("UGNAYAN NG PAHINUNGOD", "UGNAYAN NG PAHINUNGOD");
					break;
				case 16:
					dept.department.options[0] = new Option("SCHOOL OF ENVIRONMENTAL SCIENCE & MGT", "SCHOOL OF ENVIRONMENTAL SCIENCE & MGT");
					break;
			}
		}
	</script>
<script>
	var timeout = 500;
	var closetimer = 0;
	var ddmenuitem = 0;

	function jsddm_open()
	{  jsddm_canceltimer();
	   jsddm_close();
	   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

	function jsddm_close()
	{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

	function jsddm_timer()
	{  closetimer = window.setTimeout(jsddm_close, timeout);}

	function jsddm_canceltimer()
	{  if(closetimer)
	   {  window.clearTimeout(closetimer);
		  closetimer = null;}}

	$(document).ready(function()
	{  $('#jsddm > li').bind('mouseover', jsddm_open)
	   $('#jsddm > li').bind('mouseout',  jsddm_timer)});

	document.onclick = jsddm_close;

	function registerpage(){
		window.location = "register.php";
	}		
		
	$(document).ready(function(){
						   
	   $("a").css({
		'text-decoration':'none',
	   });
	   $("a").hover(function () {
			$(this).css({'text-decoration':'none','font-weight':'bold'});
		  }, function () {
			var cssObj = {
			  'text-decoration':'none',
			  'font-weight':''
			}
			$(this).css(cssObj);
		  });
								   
	   $("#submitData").css({
			'background-color':'white',
			'color':'#2F2825'
		});
		$("#submitData").hover(function () {
			$(this).css({'background-color' : '#993333','color':'white','font-weight':'bold'});
		  }, function () {
			var cssObj = {
			  'background-color' : 'white',
			  'color' : '#2F2825',
			  'font-weight':''
			}
			$(this).css(cssObj);
		  });
		  
	  $("#department").css({'width':'150px'});
	 });
</script>
</head>
<body>
<!-- start header -->
<div id="header">
	<div id="logo">
		<h1><span>UPLB</span> &nbsp; Leave Application</h1>
		<ul id="jsddm">
			<li><a href="#">ACTIONS <span>&#x25BC</span></a>
				<ul>
					<li><a href="AddEmployee.php">Add Employee</a></li>
					<li><a href="searchEmployee.php">Change Employee</a></li>
				</ul>
			</li>
			<li><a href="logout.php">LOG OUT</a>
			</li>
		</ul>
	</div>
</div>
<!-- end header -->
<div id="wrapper">
	<!-- start page -->
	<div id="page">
	<div id="page-bg">
		<div id="sidebar1" class="sidebar">			
		</div>
		<!-- start content -->
		<div id="content">
			<div class="post">
				<div class="entry">
	<?php
		require_once('functions.php');
	

		
		function checkAppointment($date)
		{
			if(strlen($date) != 10)
			{
				return false;
			}
			else
			{
				if(substr($date, 2, 1) == '/' && substr($date, 5, 1) == '/')
				{
					if(is_numeric(substr($date, 0, 2)) && is_numeric(substr($date, 3, 2)) && is_numeric(substr($date, 6, 4)))
					{
						return true;
					}
					else
					{
						return false;
					}
				}
				else
				{
					return false;
				}
			}
		}
		
		$validDate = 1;
		$errorValid = false;
		$empNoFlag = 1;
		$fNameFlag = 1;
		$mNameFlag = 1;
		$lNameFlag = 1;
		$orAppFlag = 1;
		$firstName = $_POST['employeeFirstName'];
		$middleName = $_POST['employeeMiddleName'];
		$lastName = $_POST['employeeLastName'];
		$empNo = $_POST['employeeNumber'];
		$origApp = $_POST['originalAppointment'];
	
		$empExistFlag = 1;
		$queryFlag = 1;
		$queryExecFlag = 1;
		
		$success = 0;
		if(nameValidator($firstName) == false)
		{
			$errorValid = true;
			$fNameFlag = 0;
		}
		if(nameValidator($middleName) == false)
		{
			$errorValid = true;
			$mNameFlag = 0;
		}
		if(nameValidator($lastName) == false)
		{
			$errorValid = true;
			$lNameFlag = 0;
		}
		if(checkEmpNo($empNo) == false)
		{
			$errorValid = true;
			$empNoFlag = 0;
		}
		if(checkAppointment($origApp) == false)
		{
			$errorValid = true;
			$orAppFlag = 0;
		}
		$empCtr=0;
		$link = makeSQLconnection();
		$q1 = sprintf("SELECT * FROM `EMPLOYEE` WHERE `Employee_number` = '$empNo'");
		$r1 = mysql_query($q1, $link);
		if ($r1) {
			while($data=mysql_fetch_assoc($r1)){
				$empCtr++;
			}
			if($empCtr>0){
				$empExistFlag = 0;
				$errorValid = true;
			} 
		}
		
		$errorDate = validateDate(substr($origApp, 0, 2), substr($origApp, 3, 2), substr($origApp, 6, 4));
		if($errorDate == false){
			$errorValid = true;
			$validDate = 0;
		}
		
		if(!$errorValid == true){

		if(isset($_POST['submitData']) && $empNoFlag != 0 && $fNameFlag != 0 && $mNameFlag != 0 && $lNameFlag != 0 && $orAppFlag != 0 && isset($_POST['gender']) && isset($_POST['department'])){
						
						$link = makeSQLconnection();
						$empNo = $_POST['employeeNumber'];
						$fName = $_POST['employeeFirstName'];
						$mName = $_POST['employeeMiddleName'];
						$lName = $_POST['employeeLastName'];
						$oApp = $_POST['originalAppointment'];
						$class = $_POST['classification'];
						$unit = $_POST['unit'];
						$dept = $_POST['department'];
						$status = $_POST['status'];
						$gender = $_POST['gender'];
						
						
						$oaMonth=substr($oApp, 0, 2);
						$oaDay=substr($oApp, 3, 2);
						$oaYear=substr($oApp, 6, 4);
						
						$oApp = $oaYear . "/" . $oaMonth . "/" . $oaDay;
						
						
						
							
								$q2 = sprintf("INSERT INTO `EMPLOYEE` VALUES ('$empNo', '$fName', '$mName', '$lName', '$oApp', '$class', '$unit', '$dept', '$status', '$gender')");
								$r2 = mysql_query($q2, $link);
								if (!$r2) {
									//echo 'Query Failed!';
									$queryFlag = 0;
								} else {
									$success = 1;
								}
							
						
						
					mysql_close($link);
					}
					if ($success == 1)
					{
						echo"
							
							<center>The employee ". $_POST['employeeFirstName'] . " " . $_POST['employeeMiddleName'] . " " . $_POST['employeeLastName'] ." has been added to the database.</center></br>
							
							<form action='searchEmployee.php'>
								<center><input type='submit' value='Return'/></center>
							</form>
							
							";
					}
			
		 
		 
			
		
				
		
		//------------------------------------------------------------------------------------------------------
		
		}else {
			?> 			
				<center>Error in input/s.</center>
				<?php 
					if($queryFlag == 0) {
						echo "<br/><center><span class='error'>Query failed!</span></center>"; 
					} else if ($queryExecFlag == 0) {
						echo "<br/><center></span class='error'>Unable to execute query:' . mysql_error()</span></center>";
					} 
				?>
				</br>
				<form name='employeeData' method='post' action='AddEmployeeValidation.php' id='empData'>
				<table>
				<tr>
					<td align='left'>
						Employee number: 
					</td>
					<td>
						<input type='text' name='employeeNumber' id='employeeNumber' maxlength='9' value="<?php echo $empNo ?>"/>
					</td>
					<td>
					<?php 
						if($empNoFlag == 0){
							echo "<span class='error'>Invalid (ex: 123456789)</span>";
						} else if ($empExistFlag == 0) {
							echo "<span class='error'>This employee has already been added to the database!</span>";
						}
					?>
					</td>
				</tr>
				<tr>
					<td align='left'>
						First Name: 
					</td>
					<td>
						<input type='text' name='employeeFirstName' id='employeeFirstName'value="<?php echo $firstName?>" />
					</td>
					<td>
					<?php 
						if($fNameFlag == 0){
							echo "<span class='error'>Please enter your correct first name! (ex: Rommel)</span>";
						}
					?>
					<td>
				</tr>
				<tr>
					<td align='left'>
						Middle Name: 
					</td>
					<td>
						<input type='text' name='employeeMiddleName' id='employeeMiddleName'value="<?php echo $middleName?>" />
					</td>
					<td>
					<?php 
						if($mNameFlag == 0){
							echo "<span class='error'>Invalid (ex: Tralala)</span>";
						}
					?>
					</td>
				</tr>
				<tr>
					<td align='left'>
						Last Name: 
					</td>
					<td>
						<input type='text' name='employeeLastName' id='employeeLastName' value="<?php echo $lastName ?>"/>
					</td>
					<td>
					<?php 
						if($lNameFlag == 0){
							echo "<span class='error'>Invalid (ex: Bulalacao)</span>";
						}
					?>
					</td>
				</tr>
				<tr>
					<td align='left'>
						Original App:<eric>(mm/dd/yyyy)</eric>
					</td>
					<td>
						<input type='text' name='originalAppointment' id='originalAppointment' maxlength='10' value="<?php echo $origApp?>" />
					</td>
					<td>
					<?php
						if($orAppFlag == 0)
						{
							echo "<span class='error'>Invalid (ex: 01/01/2009)</span>";
						}
						else if($validDate == 0)
						{
							echo "<span class='error'>Invalid Date</span>";
						}
					?>
					</td>
				</tr>
				<tr>
					<td align='left'>
						Classification:
					</td>
					<td>
						<select name='classification' id='classification'>
						<?php
							if($_POST['classification'] == 'Faculty'){
						?>
							<option name='faculty' value='Faculty' selected>Faculty</option>
							<option name='rep' value='Rep'>Rep</option>
							<option name='admin' value='Admin'>Admin</option>
							<option name='facrep' value='FacRep'>Fac-Rep</option>
						<?php
							}else if($_POST['classification'] == 'Rep'){
						?>
							<option name='faculty' value='Faculty'>Faculty</option>
							<option name='rep' value='Rep' selected>Rep</option>
							<option name='admin' value='Admin'>Admin</option>
							<option name='facrep' value='FacRep'>Fac-Rep</option>
						<?php
							}else if($_POST['classification'] == 'Admin'){
						?>
							<option name='faculty' value='Faculty'>Faculty</option>
							<option name='rep' value='Rep'>Rep</option>
							<option name='admin' value='Admin' selected>Admin</option>
							<option name='facrep' value='FacRep'>Fac-Rep</option>
						<?php
							}else{
						?>
							<option name='faculty' value='Faculty'>Faculty</option>
							<option name='rep' value='Rep'>Rep</option>
							<option name='admin' value='Admin'>Admin</option>
							<option name='facrep' value='FacRep' selected>Fac-Rep</option>
						<?php
							}
						?>
						</select>
					</td>
				</tr>
				<tr>
					<td align='left'>
						Unit:
					</td>
					<td>
						<select name='unit' id='unit' onchange="fill_Dept(document.employeeData.unit.selectedIndex);">
						<option name='CA' value='CA' <?php if($_POST['unit']=="CA") echo "selected"; ?>>CA</option>
						<option name='CAS' value='CAS'<?php if($_POST['unit']=="CAS") echo "selected"; ?> >CAS</option>
						<option name='CDC' value='CDC' <?php if($_POST['unit']=="CDC") echo "selected"; ?>>CDC</option>
						<option name='CEAT' value='CEAT' <?php if($_POST['unit']=="CEAT") echo "selected"; ?>>CEAT</option>
						<option name='CEM' value='CEM' <?php if($_POST['unit']=="CEM") echo "selected"; ?>>CEM</option>
						<option name='CFNR' value='CFNR' <?php if($_POST['unit']=="CFNR") echo "selected"; ?>>CFNR</option>
						<option name='CHE' value='CHE' <?php if($_POST['unit']=="CHE") echo "selected"; ?>>CHE</option>
						<option name='CPAF' value='CPAF' <?php if($_POST['unit']=="CPAF") echo "selected"; ?>>CPAF</option>
						<option name='CVM' value='CVM' <?php if($_POST['unit']=="CVM") echo "selected"; ?>>CVM</option>
						<option name='GS' value='GS' <?php if($_POST['unit']=="GS") echo "selected"; ?>>GS</option>
						<option name='OC' value='OC' <?php if($_POST['unit']=="OC") echo "selected"; ?>>OC</option>
						<option name='OVCA' value='OVCA' <?php if($_POST['unit']=="OVCA") echo "selected"; ?>>OVCA</option>
						<option name='OVCCA' value='OVCCA' <?php if($_POST['unit']=="OVCCA") echo "selected"; ?>>OVCCA</option>
						<option name='OVCI' value='OVCI' <?php if($_POST['unit']=="OVCI") echo "selected"; ?>>OVCI</option>
						<option name='OVCPD' value='OVCPD' <?php if($_POST['unit']=="OVCPD") echo "selected"; ?>>OVCPD</option>
						<option name='OVCRE' value='OVCRE' <?php if($_POST['unit']=="OVCRE") echo "selected"; ?>>OVCRE</option>
						<option name='SESAM' value='SESAM' <?php if($_POST['unit']=="SESAM") echo "selected"; ?>>SESAM</option>
						</select>
					</td>
				</tr>
				<tr>
					<td align='left'>
						Department:
					</td>
					<td>
						<select name='department' id='department'>
						<?php
							if($_POST['unit']=="CA"){
						?>
							<option value='AGRICULTURAL SYSTEMS CLUSTER' <?php if($_POST['department']=="AGRICULTURAL SYSTEMS CLUSTER") echo "selected"; ?> >AGRICULTURAL SYSTEMS CLUSTER</option>
							<option value='ANIMAL AND DAIRY SCIENCES CLUSTER' <?php if($_POST['department']=="ANIMAL AND DAIRY SCIENCES CLUSTER") echo "selected"; ?> >ANIMAL AND DAIRY SCIENCES CLUSTER</option>
							<option value='CENTRAL EXPERIMENT STATION' <?php if($_POST['department']=="CENTRAL EXPERIMENT STATION") echo "selected"; ?> >CENTRAL EXPERIMENT STATION</option>
							<option value='CROP PROTECTION CLUSTER' <?php if($_POST['department']=="CROP PROTECTION CLUSTER") echo "selected"; ?> >CROP PROTECTION CLUSTER</option>
							<option value='CROP SCIENCE CLUSTER' <?php if($_POST['department']=="CROP SCIENCE CLUSTER") echo "selected"; ?> >CROP SCIENCE CLUSTER</option>
							<option value='DEAN`S OFFICE' <?php if($_POST['department']=="DEAN`S OFFICE") echo "selected"; ?> >DEAN`S OFFICE</option>
							<option value='FOOD SCIENCE CLUSTER' <?php if($_POST['department']=="FOOD SCIENCE CLUSTER") echo "selected"; ?> >FOOD SCIENCE CLUSTER</option>
							<option value='LA GRANJA RES & TRNG STATION' <?php if($_POST['department']=="LA GRANJA RES & TRNG STATION") echo "selected"; ?> >LA GRANJA RES & TRNG STATION</option>
							<option value='PHIL AGRICULTURAL SCIENTIST' <?php if($_POST['department']=="PHIL AGRICULTURAL SCIENTIST") echo "selected"; ?> >PHIL AGRICULTURAL SCIENTIST</option>
							<option value='SECRETARY`S OFFICE' <?php if($_POST['department']=="SECRETARY`S OFFICE") echo "selected"; ?> >SECRETARY`S OFFICE</option>
						<?php
							}else if($_POST['unit']=="CAS"){
						?>
							<option value='DEAN`S OFFICE' <?php if($_POST['department']=="DEAN`S OFFICE") echo "selected";?> >DEAN`S OFFICE</option>
							<option value='HUMAN KINETICS' <?php if($_POST['department']=="HUMAN KINETICS") echo "selected"; ?> >HUMAN KINETICS</option>
							<option value='HUMANITIES' <?php if($_POST['department']=="HUMANITIES") echo "selected"; ?> >HUMANITIES</option>
							<option value='INST OF BIOLOGICAL SCIENCES' <?php if($_POST['department']=="INST OF BIOLOGICAL SCIENCES") echo "selected"; ?> >INST OF BIOLOGICAL SCIENCES</option>
							<option value='INST OF CHEMISTRY' <?php if($_POST['department']=="INST OF CHEMISTRY") echo "selected"; ?> >INST OF CHEMISTRY</option>
							<option value='INST OF COMPUTER SCIENCE' <?php if($_POST['department']=="INST OF COMPUTER SCIENCE") echo "selected"; ?> >INST OF COMPUTER SCIENCE</option>
							<option value='INST OF MATH SCI & PHYSICS' <?php if($_POST['department']=="INST OF MATH SCI & PHYSICS") echo "selected"; ?> >INST OF MATH SCI & PHYSICS</option>
							<option value='INST OF STATISTICS' <?php if($_POST['department']=="INST OF STATISTICS") echo "selected"; ?> >INST OF STATISTICS</option>
							<option value='SECRETARY`S OFFICE' <?php if($_POST['department']=="SECRETARY`S OFFICE") echo "selected"; ?> >SECRETARY`S OFFICE</option>
							<option value='SOCIAL SCIENCES' <?php if($_POST['department']=="SOCIAL SCIENCES") echo "selected"; ?> >SOCIAL SCIENCES</option>
							<option value='UP RURAL HIGH SCHOOL' <?php if($_POST['department']=="UP RURAL HIGH SCHOOL") echo "selected"; ?> >UP RURAL HIGH SCHOOL</option>
							<option value='UPLB LIMNOLOGICAL STATION' <?php if($_POST['department']=="UPLB LIMNOLOGICAL STATION") echo "selected"; ?> >UPLB LIMNOLOGICAL STATION</option>
						<?php
							}else if($_POST['unit']=="CDC"){
						?>
							<option value='COLLEGE SECRETARY'S OFFICE' <?php if($_POST['department']=="COLLEGE SECRETARY'S OFFICE") echo "selected"; ?> >COLLEGE SECRETARY'S OFFICE</option>
							<option value='DEAN`S OFFICE' <?php if($_POST['department']=="DEAN`S OFFICE") echo "selected"; ?> >DEAN`S OFFICE</option>
							<option value='DEPT OF DEVELOPMENT BROADCASTING & TELECOMMUNICATION' <?php if($_POST['department']=="DEPT OF DEVELOPMENT BROADCASTING & TELECOMMUNICATION") echo "selected"; ?> >DEPT OF DEVELOPMENT BROADCASTING & TELECOMMUNICATION</option>
							<option value='DEPT OF DEVELOPMENT JOURNALISM' <?php if($_POST['department']=="DEPT OF DEVELOPMENT JOURNALISM") echo "selected"; ?> >DEPT OF DEVELOPMENT JOURNALISM</option>
							<option value='DEPT OF EDUCATIONAL COMMUNICATION' <?php if($_POST['department']=="DEPT OF EDUCATIONAL COMMUNICATION") echo "selected"; ?> >DEPT OF EDUCATIONAL COMMUNICATION</option>
							<option value='DEPT OF SCIENCE COMMUNICATION' <?php if($_POST['department']=="DEPT OF SCIENCE COMMUNICATION") echo "selected"; ?> >DEPT OF SCIENCE COMMUNICATION</option>
						<?php
							}else if($_POST['unit']=="CEAT"){
						?>
							<option value='AMDP' <?php if($_POST['department']=="AMDP") echo "selected"; ?> >AMDP</option>
							<option value='AMTEC' <?php if($_POST['department']=="AMTEC") echo "selected"; ?> >AMTEC</option>
							<option value='CHEMICAL ENGINEERING' <?php if($_POST['department']=="CHEMICAL ENGINEERING") echo "selected"; ?> >CHEMICAL ENGINEERING</option>
							<option value='CIVIL ENGINEERING' <?php if($_POST['department']=="CIVIL ENGINEERING") echo "selected"; ?> >CIVIL ENGINEERING</option>
							<option value='DEAN`S OFFICE' <?php if($_POST['department']=="DEAN`S OFFICE") echo "selected"; ?> >DEAN`S OFFICE</option>
							<option value='DEPT OF INDUSTRIAL ENGINEERING' <?php if($_POST['department']=="DEPT OF INDUSTRIAL ENGINEERING") echo "selected"; ?> >DEPT OF INDUSTRIAL ENGINEERING</option>
							<option value='ELECTRICAL ENGINEERING' <?php if($_POST['department']=="ELECTRICAL ENGINEERING") echo "selected"; ?> >ELECTRICAL ENGINEERING</option>
							<option value='ENGINEERING SCIENCE' <?php if($_POST['department']=="ENGINEERING SCIENCE") echo "selected"; ?> >ENGINEERING SCIENCE</option>
							<option value='INST OF AG ENGINEERING' <?php if($_POST['department']=="INST OF AG ENGINEERING") echo "selected"; ?> >INST OF AG ENGINEERING</option>
							<option value='LIBRARY' <?php if($_POST['department']=="LIBRARY") echo "selected"; ?> >LIBRARY</option>
							<option value='SECRETARY`S OFFICE' <?php if($_POST['department']=="SECRETARY`S OFFICE") echo "selected"; ?> >SECRETARY`S OFFICE</option>
						<?php
							}else if($_POST['unit']=="CEM"){
						?>
							<option value='DEAN`S OFFICE' <?php if($_POST['department']=="DEAN`S OFFICE") echo "selected"; ?> >DEAN`S OFFICE</option>
							<option value='DEPT OF AGRIBUSINESS AND MANAGEMENT' <?php if($_POST['department']=="DEPT OF AGRIBUSINESS AND MANAGEMENT") echo "selected"; ?> >DEPT OF AGRIBUSINESS AND MANAGEMENT</option>
							<option value='DEPT OF AGRICULTURAL ECONOMICS' <?php if($_POST['department']=="DEPT OF AGRICULTURAL ECONOMICS") echo "selected"; ?> >DEPT OF AGRICULTURAL ECONOMICS</option>
							<option value='DEPT OF ECONOMICS' <?php if($_POST['department']=="DEPT OF ECONOMICS") echo "selected"; ?> >DEPT OF ECONOMICS</option>
							<option value='INSTITUTE OF COOPERATIVES AND BIO-ENTERPRISE DEVELOPMENT' <?php if($_POST['department']=="INSTITUTE OF COOPERATIVES AND BIO-ENTERPRISE DEVELOPMENT") echo "selected"; ?> >INSTITUTE OF COOPERATIVES AND BIO-ENTERPRISE DEVELOPMENT</option>
							<option value='SECRETARY`S OFFICE' <?php if($_POST['department']=="SECRETARY`S OFFICE") echo "selected"; ?> >SECRETARY`S OFFICE</option>
						<?php
							}else if($_POST['unit']=="CFNR"){
						?>
							<option value='ADMINISTRATIVE SERVICES OFFICE' <?php if($_POST['department']=="ADMINISTRATIVE SERVICES OFFICE") echo "selected"; ?> >ADMINISTRATIVE SERVICES OFFICE</option>
							<option value='COLLEGE LIBRARY' <?php if($_POST['department']=="COLLEGE LIBRARY") echo "selected"; ?> >COLLEGE LIBRARY</option>
							<option value='COLLEGE SECRETARY`S OFFICE' <?php if($_POST['department']=="COLLEGE SECRETARY`S OFFICE") echo "selected"; ?> >COLLEGE SECRETARY`S OFFICE</option>
							<option value='DEPT OF FOREST BIOLOGICAL SCIENCES' <?php if($_POST['department']=="DEPT OF FOREST BIOLOGICAL SCIENCES") echo "selected"; ?> >DEPT OF FOREST BIOLOGICAL SCIENCES</option>
							<option value='DEPT OF FOREST PRODUCTS & PAPER SCIENCE' <?php if($_POST['department']=="DEPT OF FOREST PRODUCTS & PAPER SCIENCE") echo "selected"; ?> >DEPT OF FOREST PRODUCTS & PAPER SCIENCE</option>
							<option value='DEPT OF SOCIAL FORESTRY & FOREST GOVERNANCE' <?php if($_POST['department']=="DEPT OF SOCIAL FORESTRY & FOREST GOVERNANCE") echo "selected"; ?> >DEPT OF SOCIAL FORESTRY & FOREST GOVERNANCE</option>
							<option value='FORESTRY DEVELOPMENT CENTER' <?php if($_POST['department']=="FORESTRY DEVELOPMENT CENTER") echo "selected"; ?> >FORESTRY DEVELOPMENT CENTER</option>
							<option value='INST OF AGROFORESTRY' <?php if($_POST['department']=="INST OF AGROFORESTRY") echo "selected"; ?> >INST OF AGROFORESTRY</option>
							<option value='INST OF RENEWABLE NATURAL RESOURCES' <?php if($_POST['department']=="INST OF RENEWABLE NATURAL RESOURCES") echo "selected"; ?> >INST OF RENEWABLE NATURAL RESOURCES</option>
							<option value='MAKILING CENTER FOR MOUNTAIN ECOSYSTEMS' <?php if($_POST['department']=="MAKILING CENTER FOR MOUNTAIN ECOSYSTEMS") echo "selected"; ?> >MAKILING CENTER FOR MOUNTAIN ECOSYSTEMS</option>
							<option value='OFFICE OF THE ASSOCIATE DEAN' <?php if($_POST['department']=="OFFICE OF THE ASSOCIATE DEAN") echo "selected"; ?> >OFFICE OF THE ASSOCIATE DEAN</option>
							<option value='OFFICE OF THE COORDINATOR FOR RESEARCH & EXTESION' <?php if($_POST['department']=="OFFICE OF THE COORDINATOR FOR RESEARCH & EXTESION") echo "selected"; ?> >OFFICE OF THE COORDINATOR FOR RESEARCH & EXTESION</option>
							<option value='OFFICE OF THE DEAN' <?php if($_POST['department']=="OFFICE OF THE DEAN") echo "selected"; ?> >OFFICE OF THE DEAN</option>
							<option value='TRAINING CENTER FOR TROPICAL RESOURCES & ECOSYSTEMS SUSTAINABILITY' <?php if($_POST['department']=="TRAINING CENTER FOR TROPICAL RESOURCES & ECOSYSTEMS SUSTAINABILITY") echo "selected"; ?> >TRAINING CENTER FOR TROPICAL RESOURCES & ECOSYSTEMS SUSTAINABILITY</option>
						<?php
							}else if($_POST['unit']=="CHE"){
						?>
							<option value='COMMTY & ENVIRONMNTL RES PLNG' <?php if($_POST['department']=="COMMTY & ENVIRONMNTL RES PLNG") echo "selected"; ?> >COMMTY & ENVIRONMNTL RES PLNG</option>
							<option value='DEAN`S OFFICE' <?php if($_POST['department']=="DEAN`S OFFICE") echo "selected"; ?> >DEAN`S OFFICE</option>
							<option value='HUMAN & FAMILY DEV STUDIES' <?php if($_POST['department']=="HUMAN & FAMILY DEV STUDIES") echo "selected"; ?> >HUMAN & FAMILY DEV STUDIES</option>
							<option value='IHNF-BIDANI' <?php if($_POST['department']=="IHNF-BIDANI") echo "selected"; ?> >IHNF-BIDANI</option>
							<option value='INST OF HUMAN NUTRITION & FOOD' <?php if($_POST['department']=="INST OF HUMAN NUTRITION & FOOD") echo "selected"; ?> >INST OF HUMAN NUTRITION & FOOD</option>
							<option value='SECRETARY`S OFFICE' <?php if($_POST['department']=="SECRETARY`S OFFICE") echo "selected"; ?> >SECRETARY`S OFFICE</option>
							<option value='SOCIAL DEVELOPMENT SERVICES' <?php if($_POST['department']=="SOCIAL DEVELOPMENT SERVICES") echo "selected"; ?> >SOCIAL DEVELOPMENT SERVICES</option>
						<?php
							}else if($_POST['unit']=="CPAF"){
						?>
							<option value='DEAN`S OFFICE' <?php if($_POST['department']=="DEAN`S OFFICE") echo "selected"; ?> >DEAN`S OFFICE</option>
							<option value='INST OF COMMUNITY EDUCATION' <?php if($_POST['department']=="INST OF COMMUNITY EDUCATION") echo "selected"; ?> >INST OF COMMUNITY EDUCATION</option>
							<option value='INST OF DEVELOPMENT MANAGEMENT & GOVERNANCE' <?php if($_POST['department']=="INST OF DEVELOPMENT MANAGEMENT & GOVERNANCE") echo "selected"; ?> >INST OF DEVELOPMENT MANAGEMENT & GOVERNANCE</option>
							<option value='INST OF STRATEGIC PLANNING & POLICY STUDIES' <?php if($_POST['department']=="INST OF STRATEGIC PLANNING & POLICY STUDIES") echo "selected"; ?> >INST OF STRATEGIC PLANNING & POLICY STUDIES</option>
							<option value='INSTITUTE OF AGRARIAN AND RURBAN DEVELOPMENT STUDIES' <?php if($_POST['department']=="INSTITUTE OF AGRARIAN AND RURBAN DEVELOPMENT STUDIES") echo "selected"; ?> >INSTITUTE OF AGRARIAN AND RURBAN DEVELOPMENT STUDIES</option>
							<option value='OFFICE OF THE GRADUATE PROGRAM' <?php if($_POST['department']=="OFFICE OF THE GRADUATE PROGRAM") echo "selected"; ?> ><OFFICE OF THE GRADUATE PROGRAM/option>
						<?php
							}else if($_POST['unit']=="CVM"){
						?>
							<option value='ADMINISTRATIVE SERVICES OFFICE' <?php if($_POST['department']=="ADMINISTRATIVE SERVICES OFFICE") echo "selected"; ?> >ADMINISTRATIVE SERVICES OFFICE</option>
							<option value='BASIC VETERINARY SCIENCES' <?php if($_POST['department']=="BASIC VETERINARY SCIENCES") echo "selected"; ?> >BASIC VETERINARY SCIENCES</option>
							<option value='DEAN`S OFFICE' <?php if($_POST['department']=="DEAN`S OFFICE") echo "selected"; ?> >DEAN`S OFFICE</option>
							<option value='LIBRARY' <?php if($_POST['department']=="LIBRARY") echo "selected"; ?> >LIBRARY</option>
							<option value='SECRETARY`S OFFICE' <?php if($_POST['department']=="SECRETARY`S OFFICE") echo "selected"; ?> >SECRETARY`S OFFICE</option>
							<option value='VET CLINICAL SCIENCES' <?php if($_POST['department']=="VET CLINICAL SCIENCES") echo "selected"; ?> >VET CLINICAL SCIENCES</option>
							<option value='VET PARACLINICAL SCIENCES' <?php if($_POST['department']=="VET PARACLINICAL SCIENCES") echo "selected"; ?> >VET PARACLINICAL SCIENCES</option>
							<option value='VETERINARY TEACHING HOSPITAL' <?php if($_POST['department']=="VETERINARY TEACHING HOSPITAL") echo "selected"; ?> >VETERINARY TEACHING HOSPITAL</option>
						<?php
							}else if($_POST['unit']=="GS"){
						?>
							<option value='GRADUATE SCHOOL' <?php if($_POST['department']=="GRADUATE SCHOOL") echo "selected"; ?> ></option>
						<?php
							}else if($_POST['unit']=="OC"){
						?>
							<option value='INTERNAL CONTROL OFFICE' <?php if($_POST['department']=="INTERNAL CONTROL OFFICE") echo "selected"; ?> ></option>
							<option value='LEGAL OFFICE' <?php if($_POST['department']=="LEGAL OFFICE") echo "selected"; ?> ></option>
							<option value='OFFICE FOR INITIATIVES IN CULTURE AND THE ARTS' <?php if($_POST['department']=="OFFICE FOR INITIATIVES IN CULTURE AND THE ARTS") echo "selected"; ?> ></option>
							<option value='OFFICE OF ALUMNI RELATIONS' <?php if($_POST['department']=="OFFICE OF ALUMNI RELATIONS") echo "selected"; ?> ></option>
							<option value='OFFICE OF PUBLIC RELATIONS' <?php if($_POST['department']=="OFFICE OF PUBLIC RELATIONS") echo "selected"; ?> ></option>
							<option value='OFFICE OF STUDENT AFFAIRS' <?php if($_POST['department']=="OFFICE OF STUDENT AFFAIRS") echo "selected"; ?> ></option>
							<option value='OFFICE OF THE CHANCELLOR' <?php if($_POST['department']=="OFFICE OF THE CHANCELLOR") echo "selected"; ?> ></option>
						<?php
							}else if($_POST['unit']=="OVCA"){
						?>
							<option value='ACCOUNTING OFFICE' <?php if($_POST['department']=="ACCOUNTING OFFICE") echo "selected"; ?> ></option>
							<option value='BUDGET MANAGEMENT OFFICE' <?php if($_POST['department']=="BUDGET MANAGEMENT OFFICE") echo "selected"; ?> ></option>
							<option value='BUSINESS AFFAIRS OFFICE' <?php if($_POST['department']=="BUSINESS AFFAIRS OFFICE") echo "selected"; ?> ></option>
							<option value='CASHIER`S OFFICE' <?php if($_POST['department']=="") echo "selected"; ?> ></option>
							<option value='CONTINUING EDUCATION CENTER' <?php if($_POST['department']=="CONTINUING EDUCATION CENTER") echo "selected"; ?> ></option>
							<option value='HUMAN RESOURCE DEV OFFICE' <?php if($_POST['department']=="HUMAN RESOURCE DEV OFFICE") echo "selected"; ?> ></option>
							<option value='OVCA' <?php if($_POST['department']=="OVCA") echo "selected"; ?> ></option>
							<option value='OFFICE OF THE UNIV REGISTRAR' <?php if($_POST['department']=="OFFICE OF THE UNIV REGISTRAR") echo "selected"; ?> ></option>
							<option value='RECORDS MANAGEMENT OFFICE' <?php if($_POST['department']=="RECORDS MANAGEMENT OFFICE") echo "selected"; ?> ></option>
							<option value='SPMO' <?php if($_POST['department']=="SPMO") echo "selected"; ?> ></option>
						<?php
							}else if($_POST['unit']=="OVCCA"){
						?>
							<option value='LAND GRANT MANAGEMENT OFFICE' <?php if($_POST['department']=="LAND GRANT MANAGEMENT OFFICE") echo "selected"; ?> >LAND GRANT MANAGEMENT OFFICE</option>
							<option value='OVCCA' <?php if($_POST['department']=="OVCCA") echo "selected"; ?> >OVCCA</option>
							<option value='UNIVERSITY HEALTH SERVICE' <?php if($_POST['department']=="UNIVERSITY HEALTH SERVICE") echo "selected"; ?> >UNIVERSITY HEALTH SERVICE</option>
							<option value='UNIVERSITY POLICE FORCE' <?php if($_POST['department']=="UNIVERSITY POLICE FORCE") echo "selected"; ?> >UNIVERSITY POLICE FORCE</option>
							<option value='UPLB HOUSING OFFICE' <?php if($_POST['department']=="UPLB HOUSING OFFICE") echo "selected"; ?> >UPLB HOUSING OFFICE</option>
						<?php
							}else if($_POST['unit']=="OVCI"){
						?>
							<option value='DEPT OF MILITARY SCI & TACTICS' <?php if($_POST['department']=="DEPT OF MILITARY SCI & TACTICS") echo "selected"; ?> >DEPT OF MILITARY SCI & TACTICS</option>
							<option value='INTERACTIVE LEARNING CENTER' <?php if($_POST['department']=="INTERACTIVE LEARNING CENTER") echo "selected"; ?> >INTERACTIVE LEARNING CENTER</option>
							<option value='OVCI' <?php if($_POST['department']=="OVCI") echo "selected"; ?> >OVCI</option>
							<option value='OFF OF INSTITUTIONAL LINKAGES' <?php if($_POST['department']=="OFF OF INSTITUTIONAL LINKAGES") echo "selected"; ?> >OFF OF INSTITUTIONAL LINKAGES</option>
							<option value='OFFICE OF THE UNIV REGISTRAR' <?php if($_POST['department']=="OFFICE OF THE UNIV REGISTRAR") echo "selected"; ?> >OFFICE OF THE UNIV REGISTRAR</option>
							<option value='SENTRO NG WIKANG PILIPINO' <?php if($_POST['department']=="SENTRO NG WIKANG PILIPINO") echo "selected"; ?> >SENTRO NG WIKANG PILIPINO</option>
							<option value='UNIVERSITY LIBRARY' <?php if($_POST['department']=="UNIVERSITY LIBRARY") echo "selected"; ?> >UNIVERSITY LIBRARY</option>
							<option value='UNIVERSITY PUBLICATIONS OFFICE' <?php if($_POST['department']=="UNIVERSITY PUBLICATIONS OFFICE") echo "selected"; ?> >UNIVERSITY PUBLICATIONS OFFICE</option>
						<?php
							}else if($_POST['unit']=="OVCPD"){
						?>
							<option value='CAMPUS PLANNING & DEV OFFICE' <?php if($_POST['department']=="CAMPUS PLANNING & DEV OFFICE") echo "selected"; ?> ></option>
							<option value='OVCPD' <?php if($_POST['department']=="OVCPD") echo "selected"; ?> ></option>
							<option value='PPMSO' <?php if($_POST['department']=="PPMSO") echo "selected"; ?> ></option>
							<option value='UPLB INFORMATION TECHNOLOGY CENTER' <?php if($_POST['department']=="UPLB INFORMATION TECHNOLOGY CENTER") echo "selected"; ?> ></option>
						<?php
							}else if($_POST['unit']=="OVCRE"){
						?>
							<option value='BIOTECH' <?php if($_POST['department']=="BIOTECH") echo "selected"; ?> ></option>
							<option value='MUSEUM OF NATURAL HISTORY' <?php if($_POST['department']=="MUSEUM OF NATURAL HISTORY") echo "selected"; ?> ></option>
							<option value='OVCRE' <?php if($_POST['department']=="OVCRE") echo "selected"; ?> ></option>
							<option value='UGNAYAN NG PAHINUNGOD' <?php if($_POST['department']=="UGNAYAN NG PAHINUNGOD") echo "selected"; ?> ></option>
						<?php
							}else if($_POST['unit']=="SESAM"){
						?>
							<option value='SCHOOL OF ENVIRONMENTAL SCIENCE & MGT' <?php if($_POST['department']=="SCHOOL OF ENVIRONMENTAL SCIENCE & MGT") echo "selected"; ?> ></option>
						<?php
							}
						?>
					</select>
					</td>
				</tr>
				<tr>
					<td align='left'>
						Employment Status:
					</td>
					<td>
						<select name='status' id='status'>
						<?php
							if($_POST['status'] == 'Casual'){
						?>
							<option name='casual' value='Casual' selected>Casual</option>
							<option name='substitute' value='Substitute'>Substitute</option>
							<option name='permanent' value='Permanent'>Permanent</option>
							<option name='temporary' value='Temporary'>Temporary</option>
						<?php
							}else if($_POST['status'] == 'Substitute'){
						?>
							<option name='casual' value='Casual'>Casual</option>
							<option name='substitute' value='Substitute' selected>Substitute</option>
							<option name='permanent' value='Permanent'>Permanent</option>
							<option name='temporary' value='Temporary'>Temporary</option>
						<?php
							}else if($_POST['status'] == 'Permanent'){
						?>
							<option name='casual' value='Casual'>Casual</option>
							<option name='substitute' value='Substitute'>Substitute</option>
							<option name='permanent' value='Permanent' selected>Permanent</option>
							<option name='temporary' value='Temporary'>Temporary</option>
						<?php
							}else{
						?>
							<option name='casual' value='Casual'>Casual</option>
							<option name='substitute' value='Substitute'>Substitute</option>
							<option name='permanent' value='Permanent'>Permanent</option>
							<option name='temporary' value='Temporary' selected>Temporary</option>
						<?php
							}
						?>
						</select>
					</td>
				</tr>
				<tr>
					<td align='left'>
						Gender: 
					</td>
					<td>
						<select name='gender' id='gender'>
						<?php
							if($_POST['gender'] == "Male") {
						?>
							<option name='male'  value='Male' selected>Male</option>
							<option name='female' value='Female'>Female</option>
						<?php 
							} else { 
						?>
							<option name='male'  value='Male' >Male</option>
							<option name='female' value='Female' selected>Female</option>
						<?php 
							} 
						?>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						&nbsp;
					</td>
					<td>
						<input type='submit' name='submitData' value='Submit'>
					</td>
				</tr>
				</table>
				</form>
<?php
		}
		 
?>
				</div>
			</div>
		</div>
		<!-- end content -->
		<!-- start sidebars -->
		<div id="sidebar2" class="sidebar">
		</div>
		<!-- end sidebars -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	<!-- end page -->
</div>
<div id="footer">	
</div>
</body>
</html>
<?php }
else
	header("Location: AddEmployee.php");
?>